<?php /*a:2:{s:63:"D:\phpStudy\WWW\blog\application\admin\view\index\personal.html";i:1544094846;s:48:"D:\phpStudy\WWW\blog\application\view\admin.html";i:1544171026;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>I Can Flay</title>
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/bootstrap/css/bootstrap.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/font-awesome/css/font-awesome.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/nprogress/nprogress.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/css/admin.css'); ?>">
    <script src="<?php echo asset('admin/vendors/nprogress/nprogress.js'); ?>"></script>
    <!--css内容-->
    
<link href="<?php echo asset('HHuploadify-master/dist/HHuploadify.css'); ?>" rel="stylesheet" type="text/css" >
<script src="<?php echo asset('HHuploadify-master/dist/HHuploadify.js'); ?>" type="text/javascript" ></script>

</head>
<body>
<script>NProgress.start()</script>
<div class="main">
    <nav class="navbar">
        <button class="btn btn-default navbar-btn fa fa-bars"></button>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="<?php echo url('admin/index/personal'); ?>"><i class="fa fa-user"></i>个人中心</a></li>
            <li><a href="<?php echo url('admin/index/tuichu'); ?>"><i class="fa fa-sign-out"></i>退出</a></li>
        </ul>
    </nav>
    <!--内容-->

<div class="container-fluid">
    <div class="page-title">
        <h1>我的个人资料</h1>
    </div>
    <form action="#" method="post" class="form-horizontal">
        <input type="hidden" name="id" value="<?php echo htmlentities($data['0']['id']); ?>">
        <div class="form-group">
            <label class="col-sm-3 control-label">头像</label>
            <div class="col-sm-6" id="goodslogo">
            </div>
            <input type="hidden" name="mylogo" id="goods_logo"/>
        </div>
        <div class="form-group">
            <label for="text" class="col-sm-3 control-label">用户名</label>
            <div class="col-sm-6">
                <input  class="form-control" name="username" type="type" value="<?php echo htmlentities($data['0']['username']); ?>" placeholder="用户名" readonly>
                <p class="help-block">用户名不允许修改</p>
            </div>
        </div>
        <div class="form-group">
            <label for="nickname" class="col-sm-3 control-label">昵称</label>
            <div class="col-sm-6">
                <input id="nickname" class="form-control" name="nickname" type="type" value="<?php echo htmlentities($data['0']['nickname']); ?>" placeholder="昵称">
                <p class="help-block">限制在 2-16 个字符</p>
            </div>
        </div>
        <div class="form-group">
            <label for="bio" class="col-sm-3 control-label">简介</label>
            <div class="col-sm-6">
                <textarea id="bio" class="form-control" name="content" placeholder="Bio" cols="30" rows="6"><?php echo htmlentities($data['0']['content']); ?></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-6">
                <input class="btn btn-primary" value="更新" type="submit">
                <a class="btn btn-link" id="post" href="#">修改密码</a>
            </div>
        </div>
    </form>
</div>

</div>
<div class="aside">
    <div class="profile">
        <img class="avatar" src="http://www.blog.com/<?php echo htmlentities($data['0']['mylogo']); ?>">
        <h3 class="name">admin</h3>
    </div>
    <ul class="nav">
        <li class="active">
            <a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-dashboard"></i>仪表盘</a>
        </li>
        <li>
            <a href="#menu-posts" class="collapsed" data-toggle="collapse">
                <i class="fa fa-thumb-tack"></i>文章<i class="fa fa-angle-right"></i>
            </a>
            <ul id="menu-posts" class="collapse">
                <li><a href="<?php echo url('admin/blog/index'); ?>">所有文章</a></li>
                <li><a href="<?php echo url('admin/blog/blogadd'); ?>">写文章</a></li>
                <li><a href="<?php echo url('admin/cate/index'); ?>">分类目录</a></li>
            </ul>
        </li>
        <li>
            <a href="<?php echo url('admin/discuss/index'); ?>"><i class="fa fa-comments"></i>评论</a>
        </li>
    </ul>
</div>
</body>

<!--js内容-->
<script src="<?php echo asset('admin/vendors/jquery/jquery.js'); ?>"></script>
<script src="<?php echo asset('admin/vendors/bootstrap/js/bootstrap.js'); ?>"></script>
<script src="<?php echo asset('layer/layer.js'); ?>"></script>
<script>NProgress.done()</script>

<script type="text/javascript" src="<?php echo asset('jquery-3.3.1.js'); ?>"></script>
<script type="text/javascript" src="<?php echo asset('lib/layer/2.4/layer.js'); ?>"></script>
<script>
    $(function(){
        new HHuploadify({
            container:'#goodslogo',
            single:true,
            chooseText:'选取图片',
            auto:true,
            url:"<?php echo url('admin/index/update'); ?>",
            field:'mylogo',
            //上传成功后的回调函数
            onUploadSuccess:function(file,data){
                var obj =JSON.parse(data);
                if(obj.status=='success'){
                    $('#goods_logo').val(obj.logo);
                }else{
                    layer.msg('上传图片失败',{icon:5,time:1000});
                }
            },
            onRemoved:function(){
                $('#goods_logo').val('');
            }
        });
        $('#post').click(function(){
            layer.ready(function(){
                layer.open({
                    type:2,
                    title:'修改密码',
                    maxmin:true,
                    area:['1000px','300px'],
                    content:"<?php echo url('admin/index/post'); ?>"
                });
            });
        });
        $('.form-horizontal').submit(function(evt){
            //禁止表单提交
            evt.preventDefault();
            var shuju =$(this).serialize();
            $.ajax({
                url:"<?php echo url('admin/index/personal'); ?>",
                data:shuju,
                type:'post',
                dateType:'json',
                success:function(msg){
                    if(msg==1){
                        layer.alert('更新成功',{icon:6},function(){
                            parent.location.reload();
                        })
                    }else{
                        layer.alert('更新失败',{icon:5})
                    }
                }
            })


        })
    })
</script>

</html>